import 'dart:convert';

import 'package:mziot/generated/json/base/json_field.dart';
import 'package:mziot/generated/json/scene_params_entity.g.dart';

@JsonSerializable()
class SceneParamsEntity {
  int? id;
  String? sceneName;
  String? startTime;
  String? endTime;
  int? lightRate;
  bool? isLock;
  List<SceneParamsLightOffs>? lightOffs;
  String? remark;
  List<int>? groupIds;

  SceneParamsEntity();

  factory SceneParamsEntity.fromJson(Map<String, dynamic> json) => $SceneParamsEntityFromJson(json);

  Map<String, dynamic> toJson() => $SceneParamsEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class SceneParamsLightOffs {
  int? id;
  String? start;
  String? end;
  int? rate;

  SceneParamsLightOffs();

  factory SceneParamsLightOffs.fromJson(Map<String, dynamic> json) =>
      $SceneParamsLightOffsFromJson(json);

  Map<String, dynamic> toJson() => $SceneParamsLightOffsToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
